import React from 'react';
import { connect } from 'react-redux';
import { shouldComponentUpdate } from 'react-immutable-render-mixin';
import loginSelector from '../selectors/loginSelector';
import Login from '../components/login';

class loginContainer extends React.Component {
    constructor(props) {
        super(props);
        this.shouldComponentUpdate = shouldComponentUpdate.bind(this);
    }
    //组件卸载前
    componentWillMount(){
    }
    //组件更新前
    componentWillUpdate(nextProps, nextState) {
    }
    render() {
        const { dispatch, isLogining } = this.props;
        return (
            <div>
                {isLogining && <p>logining ... </p>}
                <Login {...this.props}/>
            </div>
        )
    }
}

loginContainer.propTypes = {
    isLogin: React.PropTypes.bool.isRequired,
    isLogining: React.PropTypes.bool.isRequired
}

export default connect(loginSelector)(loginContainer);